package com.columboid.protocol.syncml.tests.resources;

public class LoginString {

	public static String getFirstLoginRequest() {
		String xml;

		xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
		xml += "<SyncML xmlns=\"http://protocol.columboid.com/syncml/representation\">";
		xml += "<SyncHdr>";
		xml += "<VerDTD>1.1</VerDTD>";
		xml += "<VerProto>SyncML/1.1</VerProto>";
		xml += "<SessionID>1</SessionID>";
		xml += "<MsgID>1</MsgID>";
		xml += "<Target>";
		xml += "<LocURI>http://www.columboid.com/Service</LocURI>";
		xml += "</Target>";
		xml += "<Source>";
		xml += "<LocURI>IMEI:/</LocURI>";
		xml += "<LocName>Bruce2</LocName>";
		xml += "</Source>";
		xml += "</SyncHdr>";
		xml += "<SyncBody>";
		xml += "<Routing>";
		xml += "<Lang>en-US</Lang>";
		xml += "<Device>GP</Device>";
		xml += "<Ver>";
		xml += "<SupportVersion>1.1</SupportVersion>";
		xml += "</Ver>";
		xml += "</Routing>";
		xml += "</SyncBody>";
		xml += "</SyncML>";

		return xml;
	}
	

	public static String getFirstLoginResponse(String nonce) {
		String xml;

		xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
		xml += "<SyncML xmlns=\"http://protocol.columboid.com/syncml/representation\">";
		xml += "<SyncHdr>";
		xml += "<VerDTD>1.1</VerDTD>";
		xml += "<VerProto>SyncML/1.1</VerProto>";
		xml += "<SessionID>1</SessionID>";
		xml += "<MsgID>1</MsgID>";
		xml += "<Target>";
		xml += "<LocURI>IMEI:493005100592800</LocURI>";
		xml += "</Target>";
		xml += "<Source>";
		xml += "<LocURI>http://www.columboid.com/Service</LocURI>";
		xml += "</Source>";
		xml += "</SyncHdr>";
		xml += "<SyncBody>";
		xml += "<Status>";
		xml += "<CmdID>1</CmdID>";
		xml += "<MsgRef>1</MsgRef>";
		xml += "<CmdRef>0</CmdRef>";
		xml += "<Cmd>SyncHdr</Cmd>";
		xml += "<TargetRef>http://www.columboid.com/Service</TargetRef>";
		xml += "<SourceRef>IMEI:493005100592800</SourceRef>";
		xml += "<Chal>";
		xml += "<Meta>";
		xml += "&lt;MetInf xmlns=\"http://protocol.columboid.com/syncml/metainfo\"&gt;";
		xml += "&lt;Format&gt;b64&lt;/Format&gt;";
		xml += "&lt;Type&gt;syncml:auth-md5&lt;/Type&gt;";
		xml += "&lt;NextNonce&gt;";
		xml += nonce;
		xml += "&lt;/NextNonce&gt;";
		xml += "&lt;/MetInf&gt;";
		
		/*xml += "&lt;Type xmlns=\"syncml:metinf\"&gt;syncml:auth-md5&lt;/Type&gt;";
		xml += "&lt;Format xmlns=\"syncml:metinf\"&gt;b64&lt;/Format&gt;";
		xml += "&lt;NextNonce xmlns=\"syncml:metinf\"&gt;";*/
		
		
		xml += "</Meta>";
		xml += "</Chal>";
		xml += "<Data>407</Data>";
		xml += "</Status>";
		xml += "</SyncBody>";
		xml += "</SyncML>";
		
		return xml;
	}
	
	
	public static String getSecondLoginRequest(String challenge)
	{
		String xml="";
		
		xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
		xml += "<SyncML xmlns=\"http://protocol.columboid.com/syncml/representation\">";
		xml += "<SyncHdr>";
		xml += "<VerDTD>1.1</VerDTD>";
		xml += "<VerProto>SyncML/1.1</VerProto>";
		xml += "<SessionID>1</SessionID>";
		xml += "<MsgID>1</MsgID>";
		xml += "<Target>";
		xml += "<LocURI>http://www.columboid.com/Service</LocURI>";
		xml += "</Target>";
		xml += "<Source>";
		xml += "<LocURI>IMEI:493005100592800</LocURI>";
		xml += "<LocName>Bruce2</LocName>";
		xml += "</Source>";
		xml += "<Cred>";
		xml += "<Meta>";
		xml += "&lt;Type xmlns=\"syncml:metinf\"&gt;syncml:auth-md5&lt;/Type&gt;";
		xml += "</Meta>";
		xml += "<Data>";
		xml += challenge;
		xml += "</Data>";
		xml += "</Cred>";
		
		xml += "</SyncHdr>";
		xml += "<SyncBody>";
		xml += "<Routing>";
		xml += "<Lang>en-US</Lang>";
		xml += "<Device>GP</Device>";
		xml += "<Ver>";
		xml += "<SupportVersion>1.1</SupportVersion>";
		xml += "</Ver>";
		xml += "</Routing>";
		xml += "</SyncBody>";
		xml += "</SyncML>";
		
		return xml;
	}
	
	public static String getClientRequiresTokenRequest(String challenge)
	{
		String xml="";
		
		xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
		xml += "<SyncML xmlns=\"http://protocol.columboid.com/syncml/representation\">";
		xml += "<SyncHdr>";
		xml += "<VerDTD>1.1</VerDTD>";
		xml += "<VerProto>SyncML/1.1</VerProto>";
		xml += "<SessionID>1</SessionID>";
		xml += "<MsgID>1</MsgID>";
		xml += "<Target>";
		xml += "<LocURI>http://www.columboid.com/Service</LocURI>";
		xml += "</Target>";
		xml += "<Source>";
		xml += "<LocURI>IMEI:493005100592800</LocURI>";
		xml += "<LocName>Bruce2</LocName>";
		xml += "</Source>";
		xml += "<Cred>";
		xml += "<Meta>";
		xml += "&lt;MetInf xmlns=\"http://protocol.columboid.com/syncml/metainfo\"&gt;";
		xml += "&lt;Format&gt;b64&lt;/Format&gt;";
		xml += "&lt;Type&gt;syncml:auth-md5&lt;/Type&gt;";
		xml += "&lt;NextNonce&gt;12345&lt;/NextNonce&gt;";
		xml += "&lt;/MetInf&gt;";
		xml += "</Meta>";
		xml += "<Data>";
		xml += challenge;
		xml += "</Data>";
		xml += "</Cred>";
		
		xml += "</SyncHdr>";
		xml += "<SyncBody>";
		xml += "<Routing>";
		xml += "<Lang>en-US</Lang>";
		xml += "<Device>GP</Device>";
		xml += "<Ver>";
		xml += "<SupportVersion>1.1</SupportVersion>";
		xml += "</Ver>";
		xml += "</Routing>";
		xml += "</SyncBody>";
		xml += "</SyncML>";
		
		return xml;
	}
	
	public static String getClientRequiresTokenResponse(String challenge)
	{
		String xml="";
		xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
		xml += "<SyncML xmlns=\"http://protocol.columboid.com/syncml/representation\">";
		xml += "<SyncHdr>";
		xml += "<VerDTD>1.1</VerDTD>";
		xml += "<VerProto>SyncML/1.1</VerProto>";
		xml += "<SessionID>1</SessionID>";
		xml += "<MsgID>2</MsgID>";
		xml += "<Target>";
		xml += "<LocURI>IMEI:493005100592800</LocURI>";
		xml += "</Target>";
		xml += "<Source>";
		xml += "<LocURI>http://www.columboid.com/Service</LocURI>";
		xml += "</Source>";
		xml += "<Cred>";
		xml += "<Data>" + challenge +"</Data>";
		xml += "</Cred>";
		xml += "</SyncHdr>";
		xml += "<SyncBody>";
		xml += "<Status>";
		xml += "<CmdID>2</CmdID>";
		xml += "<MsgRef>2</MsgRef>";
		xml += "<CmdRef>0</CmdRef>";
		xml += "<Cmd>SyncHdr</Cmd>";
		xml += "<TargetRef>http://www.columboid.com/Service</TargetRef>";
		
		xml += "<SourceRef>IMEI:493005100592800</SourceRef>";
		xml += "<Chal>";
		xml += "<Meta>";
		xml += "&lt;MetInf xmlns=\"http://protocol.columboid.com/syncml/metainfo\"&gt;";
		xml += "&lt;Format&gt;b64&lt;/Format&gt;";
		xml += "&lt;Type&gt;syncml:auth-md5&lt;/Type&gt;";
		xml += "&lt;NextNonce&gt;";
		xml += "12345";
		xml += "&lt;/NextNonce&gt;";
		xml += "&lt;/MetInf&gt;";
		xml += "</Meta>";
		xml += "</Chal>";
		xml += "<Data>" + "200" +"</Data>";
		xml += "</Status>";
		
		xml += "<Final/>";
		
		xml += "</SyncBody>";
		xml += "</SyncML>";
		return xml;
	}
	
	public static String getSucceedLoginRequest(String nonce,String statusCode)
	{
		String xml="";
		xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
		xml += "<SyncML xmlns=\"http://protocol.columboid.com/syncml/representation\">";
		xml += "<SyncHdr>";
		xml += "<VerDTD>1.1</VerDTD>";
		xml += "<VerProto>SyncML/1.1</VerProto>";
		xml += "<SessionID>1</SessionID>";
		xml += "<MsgID>2</MsgID>";
		xml += "<Target>";
		xml += "<LocURI>IMEI:493005100592800</LocURI>";
		xml += "</Target>";
		xml += "<Source>";
		xml += "<LocURI>http://www.columboid.com/Service</LocURI>";
		xml += "</Source>";
		xml += "</SyncHdr>";
		xml += "<SyncBody>";
		xml += "<Status>";
		xml += "<CmdID>2</CmdID>";
		xml += "<MsgRef>2</MsgRef>";
		xml += "<CmdRef>0</CmdRef>";
		xml += "<Cmd>SyncHdr</Cmd>";
		xml += "<TargetRef>http://www.columboid.com/Service</TargetRef>";
		
		xml += "<SourceRef>IMEI:493005100592800</SourceRef>";
		xml += "<Chal>";
		xml += "<Meta>";
		xml += "&lt;MetInf xmlns=\"http://protocol.columboid.com/syncml/metainfo\"&gt;";
		xml += "&lt;Format&gt;b64&lt;/Format&gt;";
		xml += "&lt;Type&gt;syncml:auth-md5&lt;/Type&gt;";
		xml += "&lt;NextNonce&gt;";
		xml += nonce;
		xml += "&lt;/NextNonce&gt;";
		xml += "&lt;/MetInf&gt;";
		xml += "</Meta>";
		xml += "</Chal>";
		xml += "<Data>" + statusCode +"</Data>";
		xml += "</Status>";
		if(statusCode.equals("200"))
		{
			xml += "<Final/>";
		}
		xml += "</SyncBody>";
		xml += "</SyncML>";
		return xml;
	}
	
	public static String getThridLoginRequest(String challenge,String publicKey)
	{
		String xml="";
		
		xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
		xml += "<SyncML xmlns=\"http://protocol.columboid.com/syncml/representation\">";
		xml += "<SyncHdr>";
		xml += "<VerDTD>1.1</VerDTD>";
		xml += "<VerProto>SyncML/1.1</VerProto>";
		xml += "<SessionID>1</SessionID>";
		xml += "<MsgID>1</MsgID>";
		xml += "<Target>";
		xml += "<LocURI>http://www.columboid.com/Service</LocURI>";
		xml += "</Target>";
		xml += "<Source>";
		xml += "<LocURI>IMEI:493005100592800</LocURI>";
		xml += "<LocName>Bruce2</LocName>";
		xml += "</Source>";
		xml += "<Cred>";
		xml += "<Meta>";
		xml += "&lt;Type xmlns=\"syncml:metinf\"&gt;syncml:auth-md5&lt;/Type&gt;";
		xml += "</Meta>";
		xml += "<Data>";
		xml += challenge;
		xml += "</Data>";
		xml += "</Cred>";
		
		xml += "</SyncHdr>";
		xml += "<SyncBody>";
		xml += "<Key>";
		xml += "<CmdID>1</CmdID>";
		xml += "<Data>" + publicKey + "</Data>";
		xml += "</Key>";
		xml += "</SyncBody>";
		xml += "</SyncML>";
		
		return xml;
	}
}
